SUBROUTINE CHECKBOX
*Display a simple form with one group of checkboxes, each box with the same name* Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
* Start the HTML page.* Display the text 'Form with Checkboxes' in the browser's title bar.CALL RW_START_HTML_PAGE("Form with Checkboxes", "", "", "", "")
CALL RW_PUT("Please check the relevant boxes to indicate which " : ...
"course modules you require")
* Start the HTML form, specifying that the subroutine RESPONSE should* be run when the submit button is clicked.CALL RW_START_HTML_FORM("RESPONSE","FORM5","")CALL RW_NEWLINECALL RW_CHECKBOX("module","Word Processing",0,0,"")CALL RW_PUT("Word Processing")CALL RW_NEWLINECALL RW_CHECKBOX("module","Spreadsheets",0,0,"")CALL RW_PUT("Spreadsheets")CALL RW_NEWLINECALL RW_CHECKBOX("module","Databases",0,0,"")CALL RW_PUT("Databases")CALL RW_NEWLINECALL RW_CHECKBOX("module","Web Page Design",0,0,"")CALL RW_PUT("Web Page Design")CALL RW_NEWLINES(2)CALL RW_RESET("CLEAR","Clear Selections","")*Create the submit buttonCALL RW_SUBMIT_BUTTON("Submit Details","")*Complete the formCALL RW_END_FORM* Complete the pageCALL RW_END_PAGE
RETURN
SUBROUTINE RESPONSE
*Display message acknowledging selected modules to user submitting Form* Include the RealWeb definitions
INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP
EQU VM TO CHAR(253)
* Start the HTML page.* Display the text 'Response to Form' in the browser's title bar.CALL RW_START_HTML_PAGE("Response to Form", "", "", "", "")CALL RW_PUT("Thank you for your selections")CALL RW_NEWLINE*Get the value of "module" from the form*Multiple checkboxes may be have been selected, so the value returned*will be a string of all selected modules separated by Value Marks CALL RW_GET_PARAM("module", MODULES)
IF MODULES NE "" THEN
MODULES2 = CHANGE(MODULES, VM, ", ")
CALL RW_PUT('We will send you the following modules "':MODULES2:'"')
END
* Complete the page.CALL RW_END_PAGE
RETURN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><META NAME="Generator" CONTENT="Reality"><TITLE>Form with Checkboxes</TITLE></HEAD><BODY>
Please check the relevant boxes to indicate which course modules you require
<FORM ACTION="RESPONSE" NAME="FORM5" METHOD="POST"><BR><INPUT TYPE=CHECKBOX NAME="module" VALUE="Word Processing">
Word Processing
<BR><INPUT TYPE=CHECKBOX NAME="module" VALUE="Spreadsheets">
Spreadsheets
<BR><INPUT TYPE=CHECKBOX NAME="module" VALUE="Databases">
Databases
<BR><INPUT TYPE=CHECKBOX NAME="module" VALUE="Web Page Design">
Web Page Design
<BR><BR><INPUT TYPE=RESET NAME="CLEAR" VALUE="Clear Selections"><INPUT TYPE="submit" VALUE="Submit Details"></FORM></BODY></HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><META NAME="Generator" CONTENT="Reality"><TITLE>Response to Form</TITLE></HEAD><BODY>
Thank you for your selections
<BR>
We will send you the following modules "Word Processing, Web Page Design"
</BODY></HTML>